package com.dfbz.demo;

import java.io.FileInputStream;
import java.io.ObjectInputStream;

/**
 * @author lscl
 * @version 1.0
 * @intro:
 */
public class Demo02_ObjectInputStream {
    public static void main(String[] args) throws Exception{

        ObjectInputStream ois = new ObjectInputStream(new FileInputStream("oos"));

        // 从文件中读取对象(反序列化)
        Goods goods = (Goods) ois.readObject();

        System.out.println(goods);

        ois.close();
    }
}
